> */ public function getNodeTypes() : array { return [Property::class]; } /** * @param Property $node * @return Property[]|null */ public function refactor(Node $node) : ?array { $allProperties = $node->props; if (\count($allProperties) === 1) { return null; } /** @var PropertyProperty $firstPropertyProperty */ $firstPropertyProperty = \array_shift($allProperties); $node->props = [$firstPropertyProperty]; $nextProperties = []; foreach ($allProperties as $allProperty) { $nextProperties[] = new Property($node->flags, [$allProperty], $node->getAttributes()); } return \array_merge([$node], $nextProperties); } }